package sxr.common.Enum;

/**
 * Created by xufei on 2019/10/30.
 */
public enum BusinessExceptionEnum {
    NoPermission(1000001, "权限校验,没有操作权限"),
    ParamNotFound(1000002, "权限校验,找不到参数"),
    UnknownCheckType(1000003, "权限校验,未知验证类型"),
    AppIdError(100004, "权限校验，appId不存在"),
    QueryIsEmpty(100005, "权限校验,查询数据为空"),


    PARAM_FAIL_NOTNULL(4000001, "参数不能为空"),
    DUPLICATE_KEY_CODE(4000002, "参数重复"),
    PARAM_FAIL_CODE(4000003, "参数错误"),
    PATH_NOT_EXIST(4000004, "路径不存在，请检查路径是否正确"),
    VALIDATION_CODE(4000005, "参数校验不通过"),
    ACCOUNT_EXISTS(4000010, "账号已经存在，不能重复添加"),
    ACCOUNT_NON_EXISTENT(4000011, "账号不存在"),
    GLOBAL_NON_EXISTENT(4000012, "要删除的数据不存在"),
    DATA_NOT_EXISTS(4000013, "数据不存在"),

    SYSTEM_BUSY(5000001, "系统繁忙,请稍后再试"),
    AUTH_FAILD(5000002,"认证失败"),

    DELETE_FAIL(6000001, "删除无效"),
    DATE_INVALID(7000001, "日期无效"),
    EXISTS(8000001,"该数据已存在");

    private int code;
    private String desc;

    private BusinessExceptionEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    private BusinessExceptionEnum(BusinessExceptionEnum businessExceptionEnum) {
        this.code = businessExceptionEnum.getCode();
        this.desc = businessExceptionEnum.getDesc();
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
